<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script type="module">
      import { reactive, effect } from "../reactivity/index.js";

      const product = reactive({
        name: "zs",
        price: 5000,
        count: 2,
      });
      let total = 0;
      effect(() => {
        total = product.count * product.price;
      });
      console.log(total);

      product.price = 4000;
      console.log(total);

      product.count = 1;
      console.log(total);
    </script>
  </body>
</html>
